<?php
$NRIC = $_REQUEST['NRIC'];

include 'conn.php';

$sql = "delete from client WHERE NRIC = '$NRIC'";
$result = @mysql_query($sql);

if ($result){
	echo json_encode(array('success'=>true));
} 
else {
	echo json_encode(array('msg'=>"Unable to delete client. This client's data is being used by other records!"));
	//print '<script type="text/javascript">';
	//print 'alert("The client record is being used by the other table!")';
	//print '</script>';
}
?>